package com.py.services;

import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.data.jpa.JpaRepositoriesAutoConfiguration;
import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.ImportResource;

import com.plat.paas.utils.LogUtil;
import com.plat.paas.utils.PaasUtilsContextHolder;

@SpringBootApplication
@EnableAutoConfiguration(exclude={  
      JpaRepositoriesAutoConfiguration.class,//禁止springboot自动加载持久化bean
      MongoAutoConfiguration.class//禁止实例化mongodb
      })  
@ImportResource({"classpath:PaasUtilsContext.xml","classpath:/thrift/*-services.xml"}) 
public class SpringCloudServices implements CommandLineRunner{
	
	public static void main(String[] args) {
		ApplicationContext  ctx = SpringApplication.run(SpringCloudServices.class);
		
		PaasUtilsContextHolder.setContext(ctx);
	}

	@Override
	public void run(String... args) throws Exception {
		LogUtil.info("***************************************************************");
		LogUtil.info("***************  SpringCloudServices start end  ***************");
		LogUtil.info("***************************************************************");

		while (true) {
			Thread.sleep(1000000);
		}
	}

}
